Skip to content

id(scripts): resolve prod-lines rows in the post-crate-split layout (#10603) - #10604

Merged
dezren39 merged 1 commit into
mainfrom
sweep/10603-prod-lines-crate-paths
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
sweep/10603-prod-lines-crate-paths

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Problem

pkgs/id/scripts/prod-lines-check.sh keys its grandfather allowances and module-gated test-only exemptions on pre-crate-split paths (src/cli.rs, src/directory.rs, src/web/routes.rs, src/web/markdown.rs, src/encryption/tests.rs, src/world_session/tests.rs). After the crate split the scan yields crates/<crate>/src/..., so no row could match:

  • crates/id-directory/src/directory.rs (2,536 lines, allowance 2,610) was reported as a plain 2,500 violation instead of grandfathered.
  • crates/id-groups/src/encryption/tests.rs, crates/id-worlds/src/world_session/tests.rs and crates/id-cli/src/cli/tests.rs (the last had no row at all) were reported despite #[cfg(test)] mod tests; in their parent modules.
  • The ratchet was silently unenforced: neither the allowance nor any pre-split exemption could ever match.
  • The self-test only built pre-split $tmp/src/... fixtures, which is why the regression went unnoticed.

Solution

  • Lookups try the real scanned path first, then a normalized key with the leading crates/<crate>/ stripped. A row therefore survives the split and a later move between crates; reporting still uses the real path.
  • src/directory.rs moves to crates/id-directory/src/directory.rs (same 2,610 allowance — grows still fail).
  • The obsolete src/cli.rs, src/web/routes.rs and src/web/markdown.rs rows are dropped with a recorded reason (successors are under the plain limit: routes 2,096, markdown 1,196 production lines).
  • Added the missing src/cli/tests.rs module-gated test-only row.
  • No limit, scanning rule, or reporting format changes; the F11.10 ratchet is untouched.

Verification

cd pkgs/id && bash scripts/prod-lines-check-test.sh → prod-lines-check tests passed (new crate-layout fixtures: module-gated tests, over-limit crate file, grandfathered crate file at allowance and +1 failing).

cd pkgs/id && bash scripts/prod-lines-check.sh on this branch reports exactly:

grandfathered: crates/id-directory/src/directory.rs at 2536 production lines (allowance 2610 — ...)
test-only: crates/id-cli/src/cli/tests.rs ...
test-only: crates/id-groups/src/encryption/tests.rs ...
test-only: crates/id-worlds/src/world_session/tests.rs ...
::error file=crates/id-cli/src/commands/serve.rs::... 3084 ...
::error file=crates/id-worlds/src/world/actor.rs::... 3870 ...
::error file=crates/id-worlds/src/world/core.rs::... 3168 ...
prod-lines-check: 3 file(s) over the limit

i.e. only the three genuinely over-limit production files, each already tracked by a held split issue (#8590, #8592, #8593). The basic tier goes green when those land; this PR is what makes that possible instead of being blocked on four false positives forever.

Fixes #10603


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…10603)

The grandfather and test-only tables were keyed on pre-split paths
(src/cli.rs, src/directory.rs, src/web/*.rs, src/encryption/tests.rs,
src/world_session/tests.rs). After the crate split the scan produces
crates/<crate>/src/... paths, so no row could match: the guard reported
module-gated test modules and an explicitly grandfathered file as
over-limit, and the ratchet guarded nothing.

Lookups now try the real path first and then a normalized key with the
leading crates/<crate>/ stripped, so a row keeps working across a crate
move. The directory row moves to its crate path, the three obsolete
pre-split rows are dropped (their successors are under the plain limit),
and the missing src/cli/tests.rs test-only row is added.

prod-lines-check-test.sh gains crate-layout fixtures: module-gated test
modules under crates/x/src/..., an over-limit crate file, and a
grandfathered crate file that passes at its allowance and fails one line
later. On the real tree the guard now fails only on the three files
tracked by #8590, #8592 and #8593, and reports directory.rs as
grandfathered at 2,536 <= 2,610.
@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 04:33
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T04:33:31.286313Z
We couldn’t complete this review. Comment @codex review to try again.
10e2172 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07d91918-dfab-4200-9cfc-19d0feaa5a4c
Commits

Reviewing files that changed from the base of the PR and between 330c503 and 10e2172.

Files selected for processing: 2

  • pkgs/id/scripts/prod-lines-check-test.sh
  • pkgs/id/scripts/prod-lines-check.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit b84c351 into main Nov 16, 2026
1 check passed
@dezren39
dezren39 deleted the sweep/10603-prod-lines-crate-paths branch November 16, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant